<!DOCTYPE html>
  <html>
  <head>
      <meta charset="utf-8">
      <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
      <title>title</title>
      <link rel="stylesheet" type="text/css" href="../css/api.css"/>
      <style>
      *{
  margin: 0;
  height: 0;
}
body{
  width: 100%;
  height: 100%;
  padding-top: 1.7rem;
}
.header{
      width: 93%;
      height: 2.5rem;
      line-height: 2.5rem;
      padding: 0.5rem 0.8rem;
      text-align: center;
      position: fixed;
      top:1.5rem;
      background-color: #40cccc;
      z-index: 999;
  }
.header_img{
  width: 6%;
  height: 45%;
  float: left;
  margin-top: 0.5rem;
}
.header_img img{
  width: 100%;
  height: 100%;
}
.header h3{
  line-height: 3rem;
  width: 90%;
  margin-left: 0.7rem;
  text-align: center;
  color: #fff;
}
.content{
  width: 95%;
  padding: 0.5rem;
  height:auto;
  overflow: auto;
  margin-top: 3rem;

  /*border:1px solid red;*/
}
.cont_p {
    width: auto;
    text-align: left;
    display: flex;
    padding: 1rem;
    /* justify-content: center; */
    align-items: center;
}
.cont_i{
 width: 97%;
      height: auto;
      margin: 0 auto;
}

.cont_img{
      width: 100%;
      height: 50%;
      margin: 0.5rem auto;

}
.cont_img img{
  width: 100%;
  height: 100%;
}
.cont_input {
  width: 92%;
  height:40%;
  outline: none;
  margin-left:0.3rem;;
  overflow: hidden;
  margin-top: 10%;
    /*border: 0.1rem solid red;*/
}
.cont_input textarea{
width: 63%;
height: 100%;
float: right;
outline: none;

border: 0.1rem solid rgba(243,243,243,0.5);
padding-top:0.5rem;
padding-left: 1rem;

}
.cont_inputs{
width:9.5rem;
height: 40%;
overflow: hidden;
outline: none;
margin-left: 0.4rem;
margin-bottom: 0.5rem;


}
.cont_inputs input{
color: #ccc;
width:30%;
float: right;
height: 100%;
outline: none;
padding: 0.3rem;
  /*margin-left: 0.3rem;*/
color: #ccc;
  border: 0.1rem solid rgba(243,243,243,0.5);


}
label {
display: inline;
}



.tag {
width: 100%;
height:5%;
margin-top: 7%;
margin-bottom: 0.4rem;
/*border: 0.1rem solid red;*/
overflow: hidden;
padding-left: 5px;
}
.regular-radio {
display: none;
}

.regular-radio + label {
-webkit-appearance: none;
background-color: #fff;
border: 1px solid #aaa;
padding:6px;
border-radius:50px;
display: inline-block;
position: relative;

}

.regular-radio:checked + label:after {
content: ' ';
width: 10px;
height:10px;
border-radius: 50px;
position: absolute;
top: 1px;
background: red;
left: 1px;
}
.lable{
width: 10%;
margin-left:5%;
}
button{
width:90%;
height: 2.5rem;
margin-left:5%;
outline: none;
border:0;
background-color: #40cccc;
color:#fff;
text-align: center;
line-height: 2.5rem;
border-radius: 1.5rem;
margin-top:12%;
}
.img{
z-index: 99;
}
      </style>
  </head>
  <body>
    <div class="header">
      <div class="header_img">
        <img src="../image/u18.png" alt="" onclick="closewin()">
      </div>
      <h3>批阅作业</h3>
    </div>
    <div class="content">

    <div class="cont_i">
      <p class="cont_p fl" id="wz"></p>
    	<div class="cont_img fl" id="zys">



    		<!-- <img src="../image/u28.jpg" class="img"> -->

    		</div>
    </div>


    <div  class="cont_inputs fl">
      <p style="width: 55%; height: 100%;float:left;line-height:2rem;	">作业分数：</p>

    <input type="text" name="" placeholder="70分" id="fx">
    </div>
    <div class="tag fl">
        <p style="width:25%; height: 100%;float:left;	">作业质量：</p>
        <div class="button-holder" style="float:left;">
          <input type="radio" id="radio-1-1" name="radio-1-set" class="regular-radio" checked=""><label for="radio-1-1" style="margin-left:8px"></label><span style="margin-left:0.3rem;">优</span>
          <input type="radio" id="radio-1-2" name="radio-1-set" class="regular-radio"><label for="radio-1-2" style="margin-left:8px"></label><span style="margin-left:0.3rem;">良</span>
        </div>
      </div>
    <div  class="cont_input fl">
  <p style="width:28%; height: 100%;float:left;line-height:2rem;	">作业评语：</p>
    <textarea type="text" name="" placeholder="继续加油哦" id="py"></textarea>
    </div>
    <button class="fl" onclick="tj()">提交</button>
    </div>
    <!-- ?\ -->
    <div id="outerdiv" style="position:fixed;top:0;left:0;background:rgba(0,0,0,0.7);z-index:2;width:100%;height:100%;display:none;">
        <div id="innerdiv" style="position:absolute;">
            <img id="bigimg" style="" src="" />
        </div>
    </div>
  </body>
  <script type="text/javascript" src="../script/api.js"></script>
  <script type="text/javascript" src="../script/common.js"></script>
  <script type="text/javascript" src="../script/jquery-1.8.3.js"></script>
  <script type="text/javascript">
      var id
      apiready = function(){
        id = api.pageParam.id
        alert(id)
        get_zy()
      };

      function tj() {
        var zl = $("input[name='radio-1-set']:checked").val();
        var fx = $("#fx").val()
        var py = $("#py").val()

        api.ajax({
            url: SITE_URL+'livebr/cur/py',
            method: 'post',
            data: {
                values: {
                    fraction: fx,
                    quality:zl,
                    titles:py,
                    id:id
                }
            }
        },function(ret, err){
            if (ret) {
              if(ret.error==200){
                msgcode('批阅成功')
                api.sendEvent({
                    name: 'pyzy',

                });
                setTimeout(function () {
                  api.closeWin({

                  });

                },1000)

              }else{
                msgcode('稍后再试')
              }

//                alert( JSON.stringify( ret ) );
            } else {
              msgcode('请检查网络连接')
                //alert( JSON.stringify( err ) );
            }
        });

      }
      function get_zy() {
        var html =''
        var obj = $api.byId('zys');

        api.ajax({
            url: SITE_URL+'livebr/cur/zy',
            method: 'post',
            data: {
                values: {
                    id:id
                }
            }
        },function(ret, err){
            if (ret) {
              if(ret.error==200){
                if(ret.data.img_list.length>0 && ret.data.img_list!=""){
                  for (var i = 0; i < ret.data.img_list.length; i++) {
                    var dat = ret.data.img_list[i]
                    html +='<img src="'+dat+'" class="img">'
                  }

                  $api.append(obj, html);

                }
                $("#wz").html(ret.data.content)
              }else{
                msgcode('加载数据出错')
              }
              alert( JSON.stringify( ret ) );
            } else {
              msgcode('请检查网络连接')
  //              alert( JSON.stringify( err ) );
            }
        });

      }
  </script>
  </html>
